package com.credit.management.system.generator.dao;

import com.credit.management.system.model.Approve;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

public interface ApproveMapper {
    @Delete({
        "delete from approve",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(Integer id);

    @Insert({
        "insert into approve (id, projectid, ",
        "apid, apstate, apdescribe)",
        "values (#{id,jdbcType=INTEGER}, #{projectid,jdbcType=INTEGER}, ",
        "#{apid,jdbcType=INTEGER}, #{apstate,jdbcType=VARCHAR}, #{apdescribe,jdbcType=VARCHAR})"
    })
    int insert(Approve record);

    int insertSelective(Approve record);

    @Select({
        "select",
        "id, projectid, apid, apstate, apdescribe",
        "from approve",
        "where id = #{id,jdbcType=INTEGER}"
    })
    @ResultMap("com.credit.management.system.generator.dao.ApproveMapper.BaseResultMap")
    Approve selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(Approve record);

    @Update({
        "update approve",
        "set projectid = #{projectid,jdbcType=INTEGER},",
          "apid = #{apid,jdbcType=INTEGER},",
          "apstate = #{apstate,jdbcType=VARCHAR},",
          "apdescribe = #{apdescribe,jdbcType=VARCHAR}",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(Approve record);
}